Tilt correction of electronic images

ABSTRACT

A method of correcting the tilt, or rotation, of a casually captured image is described. Having corrected the rotation of the original image, the image is cropped by determining a crop boundary by applying one or more rules of composition to the image. The resulting image is more satisfactorily composed compared with prior art methods.

[0001] The present invention relates to a method of correcting the tilt, or rotation, of an electronic image by cropping a rotated version of the original image in accordance with a predefined set of image composition rules. The present invention also relates to an image processing system employing this method and an image capture system incorporating such an image processing system.

[0002] When photographs are taken without due care by a photographer the camera may not be correctly orientated with respect to the horizontal. This results in a tilted, or rotated, image. The tilt can be corrected by rotating the electronic image by an angle equal to the angle to the horizontal that the camera was originally held at. However, the rotated image must typically be cropped to generate a final image rectangle with horizontal and vertical edges. A problem then arises of how best to select the position of this cropped image.

[0003] The above problem also applies to images recorded by a video camera, because moving images are being continuously recorded onto a recording medium, it is advantageous to correct the tilt of the camera before the moving images are stored.

[0004] Image handling systems have been proposed to address the problem of tilt.

[0005] EP 949802 discloses a scanner for scanning a document. The document may be presented in a document carrier, typically a transparent envelope, in order to protect it from damage by a feed mechanism incorporated within the scanner. The scanner automatically ignores components in the scanned image due to the document carrier or resulting from imaging parts of the scanner. The scanner seeks to identify the edges of the scanned document in order to determine the skew of the document with respect to the scanner. The de-skew process does not take account of the content of the document. Hence it cannot work if the image in a scanned photograph is skewed.

[0006] GB 2124055 relates to a photographic processing system. The system allows a user to set up a rough sketch pattern showing which portions of a plurality of input images are to be placed in an output image. The sketch needs to be determined prior to commencing a scan and write cycle as this information is used to control the position and speed of scan and write heads. Thus there is no automatic de-skewing of a picture.

[0007] GB 2350251 relates to a system for merging two or more images. One of the images is a pre-stored template having a hole therein for receiving a user generated image. The image is stored at two different resolutions, with the lower resolution image being used to display relative positioning of the two images, and the high resolution image being used to drive a printer. The system allows for the user generated image to be skewed automatically to match the general skew of a “frame” presented in the template. However the skewing is performed with respect to the edge of the user generated image. The skewing is not performed based on an analysis of the content of the image.

[0008] JP 6059430 discloses a “layout scanner” which seems to allow a user to define a trimming frame such that the user can instruct a design to be “cut out” and rotated.

[0009] Cameras containing tilt sensors to allow tilted images to be automatically corrected by electronic rotation are known. In some cases tilt sensors are applied to simply switch between recording of the image in a portrait orientation and recording the image in a landscape orientation. One example of such a system is that disclosed in U.S. Pat. No. 5,900,909. This patent discloses a method of detecting when a camera is held in a vertical “portrait” orientation and a system to automatically rotate the image such that the image is always recorded in the “landscape” horizontal position. This makes subsequent viewing of the images easier. A further example of this system is disclosed in the International application WO99/03264 that discloses a method of maintaining the aspect ratio of a captured image for both landscape and portrait images. Other, more advanced systems are also known, for example the video camera disclosed in U.S. Pat. No. 5,227,889 that employs a technique for correcting unintentional arbitrary tilt. However, a significant omission from the system disclosed in U.S. Pat. No. 5,227,889, and in other known systems, is the lack of any intelligent method for selecting where to position the crop rectangle in the rotated image. This disadvantage can most easily be understood by reference to FIGS. 1a-1 d.

[0010]FIG. 1 a schematically represents an image recorded by a camera at a skewed angle. The arrow 2 shown with the image 1 represents a true vertical line and it can therefore be seen that the image 1 has been skewed by X degrees. FIG. 1b then shows the image 1 rotated by X degrees such that the arrow 2 is now vertically orientated. The rectangle 3 (shown in chain line) illustrates one possible crop boundary that could be applied to the rotated image 1 to produce a rectangular image having the correct orientation. FIG. 1c illustrates an alternative crop boundary 4 that may be applied to the rotated image 1. Both the crop boundary 3 shown in FIG. 1b and the crop boundary 4 shown in FIG. 1c represent the largest possible rectangular crop boundary that will fit within the rotated image 1. A typical prior art solution, and that applied in U.S. Pat. No. 5,227,889, is to ensure that the centre of the crop boundary is coincident with the centre of the original image. This is illustrated in FIG. 1d, where the centre of the original image is represented by the point 7, defined by the intersection of the two opposite diagonals 5′ and 5″ of the original image, and shows the largest crop boundary that will fit within the original tilted image having its centre, as defined by diagonals 6′ and 6″, coincident with that of the original image.

[0011] This choice, or any other arbitrary choice, may not produce the best possible re-composition of the image as the choice takes no account of the subject matter of the image. It would therefore be advantageous to produce a method of correcting the tilt of an image by generating a crop boundary that does take into account the subject matter of the image.

[0012] According to a first aspect of the present invention there is provided a method of correcting the tilt of an electronic image, the method comprising: rotating an original, tilted image by a correction angle of rotation; and cropping the resulting rotated image in accordance with at least one rule selected from a predefined set of image composition rules such that the crop boundary is contained within the original image.

[0013] It is thus possible to provide a method which selects the crop boundary based on an analysis of the features within the image, rather than by merely centring the cropped image such that the centre of the cropped image is co-axial with the centre of the original image.

[0014] Preferably, the image composition rules comprise: identifying one or more elements of interest within the image; selecting one or more of said identified elements to be included within the cropped image; and generating at least one crop boundary so as to include said selected elements of interest.

[0015] Advantageously the original tilted image has a predefined aspect ratio and the resulting rotated image is cropped such that the cropped image has the same predefined aspect ratio.

[0016] The aspect ratio may correspond to that of the device used to capture the image. However, other aspect ratios may be chosen, such as those of computer monitors, wide screen or normal screen televisions, common paper sizes for printers or photographs, or user defined ratios. However, a plurality of aspect ratios may be available for use, and an image processor implementing the present invention may be free to choose between them to select the best crop to fit the area of interest.

[0017] Preferably the crop boundary is not constrained to have substantially the same orientation as the original. Thus, for example an inexperienced user may have taken a tilted photograph in portrait format. However, after taking composition into account it may well be that the only compositionally interesting part of the image should in fact be bounded by a landscape boundary. Indeed, it is not necessarily the case that the crop boundaries must be rectangular. The user may select other shaped boundaries, for example from a predetermined list of shapes.

[0018] Preferably, the generated crop boundary is smaller than the largest crop boundary that can be fitted within original tilted image.

[0019] The correcting angle of rotation may be determined at the time of capturing the original image, for example with the use of a tilt sensor attached to the original camera apparatus.

[0020] Alternatively, the correcting angle of rotation may be manually input at the time of applying the correction. A further alternative for determining the angle of rotation is by analysis of the original image. Such analysis may include identifying one or more features of the original tilted image that have a known orientation and determining the angle of rotation of said identified features with respect to their known orientation. Thus, for example, the image analysis may seek to identify the edges of buildings, and if the edges are parallel may use these edges to define the vertical direction on the assumption that walls are generally vertical. The verticals may converge within the image, but this can be accounted for in the image analysis.

[0021] According to a second aspect of the present invention there is further provided an image processing system for correcting rotation of an electronic image, comprising: an image input arranged to receive an original rotated image; an angle of rotation input arranged to receive a signal indicative of an angle of rotation associated with said original image; and an image processor responsive to said image input and said angle of rotation input and arranged to rotate said original image by said angle of rotation and to crop the resulting rotating image in accordance with at least one rule selected from a predefined set of image composition rules such that the crop boundary is contained within the original image.

[0022] According to a third aspect of the present invention there is further provided an image capture system for electronically capturing an image, comprising: optical image focussing elements for focussing said image; an electronic image conversion array arranged to convert said optically focussed image into an electronic image; a rotation calculator for determining the angle of rotation of said image capture system and generating a signal indicative of said angle of rotation; and an image processing system for correcting tilt of an electronic image, comprising:

[0023] an image input arranged to receive an original rotated image;

[0024] an angle of rotation input arranged to receive a signal indicative of said angle of rotation associated with said original image; and

[0025] an image processor for receiving said electronic image and said angle of rotation and arranged to rotate said original image to correct for said angle of rotation and to crop the resulting rotated image in accordance with a predefined set of image composition rules.

[0026] According to a fourth aspect of the present invention there is provided an electronic camera, said camera further including a data processor responsive to a rotation sensor to provide a correction to the image captured by the camera so as to re-orientate the image and then to perform image analysis to identify salient features and to generate a crop boundary around those features in accordance with predetermined rules of image composition.

[0027] The present invention will now be described, by way of example, with reference to the accompanying drawings in which:

[0028]FIGS. 1a-1 d schematically illustrate a method of correcting the tilt of a rotated image according to the prior art;

[0029]FIG. 2 shows an original tilted image requiring tilt correction;

[0030]FIG. 3 shows the image of FIG. 2 rotated to correct the tilt and illustrating the position of a cropped image in accordance with the prior art method of FIGS. 1a-1 d;

[0031]FIG. 4 shows the resulting cropped image of FIG. 3;

[0032]FIG. 5 shows the rotated image of FIG. 3 with regions of similar colour and intensity merged together;

[0033]FIG. 6 shows the saliency image of the merged image of FIG. 5;

[0034]FIG. 7 shows a cropped image of FIG. 2 according to the method of the present invention;

[0035]FIG. 8 shows an image capture system and image processing system constituting an embodiment of the present invention; and

[0036]FIG. 9 shows how the cropped image may change between landscape and portrait formats.

[0037]FIG. 2 shows an image captured whilst the camera has been held at an angle. Reasons for the camera being held at an angle may include the picture being taken in a hurry or the photographer being inexperienced in taking pictures, or inexperienced with the particular camera used. A further reason why the image may be at an angle is that the camera used to capture the image may not have had a view finder allowing the user to check the orientation of the picture. An example of such a camera without a view finder would be a camera integrated within a laptop computer. The image shown in FIG. 2 has an arrow 10 marked on it that indicates the true vertical orientation of the image.

[0038]FIG. 3 shows the image of FIG. 2 rotated such that the image is now correctly orientated. The solid diagonal lines marked on the image define the centre point of the original image and the dotted cropped boundary 15 represents the maximum rectangular crop boundary having its centre coincident with the centre of the original image. The resulting cropped image is shown in FIG. 4. This method of selecting the crop boundary to correct the tilt of an original tilted image is known from the prior art.

[0039] According to embodiments of the present invention the crop boundary is generated in accordance with known compositional rules, taking into account the subject matter of the original image. Such compositional rules are well known to professional and experienced amateur photographers and include the “rule of thirds” whereby the image is bisected into a grid of two equally spaced horizontal lines and two equally spaced vertical lines (in the manner of a “noughts and crosses” board) and elements of interest are placed either on the intersections of these lines or substantially along the lines. For example, the horizon of an image will be placed either on the upper or lower horizontal line. The arrangement of elements of interest according to the “rules of thirds” produces a compositionally pleasing image. Other rules of composition that may be applied include avoiding placing an element of interest at the very edge of the image, or even allowing the edge of an image to bisect an element of interest. A further rule of composition may be to avoid large expanses of either foreground or background having very little interest. Such rules are not “hard and fast” but are in fact heuristic in nature.

[0040] For the avoidance of doubt, simply selecting the largest crop boundary that will fit within the rotated image, as known from the prior art, is not considered to be a compositional rule as it takes no account of the subject matter, or composition of the image.

[0041] In the method of the present invention it is therefore necessary to identify elements of interest within the original image.

[0042] Various schemes are known for selecting an area of compositional significance and/or interest from an electronically captured image. One such known scheme is described in the present applications co-pending UK patent application number 0031423.7 entitled “automatic cropping of electronic images” and a PCT application based thereon. A summary of the scheme disclosed in GB 0031423.7 will now be described for the sake of completeness.

[0043] With reference to the original image shown in FIG. 3, the image is first processed in such a way that areas of similar colour, intensity and texture are merged into areas having a uniform colour and intensity. This can be seen with reference to FIG. 5. The main parts of the sky 20 have been merged to areas of uniform colour, as have the two tents 21 and 22. Large areas of the background have also been merged into areas of uniform colour, for example the grass area 24 and the diagonal areas 25 on the right hand side of the image. The techniques for merging the areas of similar colour are well known. For example, the image may be converted into a format having a compressed colour variation and then adjacent areas of similar colour or intensity may then be merged. Similarly, small areas surrounded by larger areas of similar colour or intensity may also be merged into the larger area.

[0044] The resultant image is then further processed by comparing adjacent parts of the image with each other and assigning an “interest rating” to each part of the image indicative of the difference between adjacent parts of the image. Using the “interest ratings” a final image, referred to as the saliency image, is generated in which the brightness of an area of the image is proportional to the difference in averaged colour and intensity of adjacent areas. Alternatively, saliency may be judged by comparing how much a coloured region differs from those regions which form the background in the image. The saliency image for the image picture of FIG. 3 is shown in FIG. 6. The image analysis may also look for important shapes, such as faces.

[0045] Areas having a high interest rating are shown as the brightest areas. Hence it can be seen from FIG. 6 that the main elements of interest are the running figures, and in particularly the figure marked 30, together with the tent 31 on the right hand side of image. It can also be seen that large areas of the foreground and background are judged to be of little interest. By applying heuristic rules to the saliency image shown in FIG. 6 in accordance with known photographic compositional rules, suitable crop boundaries can be defined. For example, in FIG. 6 a lower crop boundary represented by the line I-I′ can be defined below which no areas of interest are located. Similarly, a left hand side crop boundary represented by the line II-II′ can also be defined with few or no areas of interest lying to the left of this line. By defining a further two crop boundaries, III-III′ and IV-IV′, a rectangular crop boundary is defined and applied to the original rotated image. The resulting image, which is produced automatically, is shown in FIG. 7, and has a more pleasing composition than that produced by the prior art shown in FIG. 4.

[0046] By varying the rules of composition, and the weighting applied to elements of interest, the crop boundaries produced may be varied. For example, it would be possible to bias areas of interest towards those containing colours and/or intensities relating to skin tones, such that areas of the image including people, or faces, will be more likely to be included in the final crop.

[0047] Other compositional rules that may be used include minimising the amount of interest areas that touch the crop rectangle or are very close to an edge of the crop rectangle, ensuring that there are no large areas of background, and avoiding placing a dominant horizontal line near the centre or near the edge of the crop rectangles.

[0048]FIG. 8 schematically illustrates an image processing system and image capture system that operate according to the present invention. An image 40 is captured using an optical lens system 42 that focuses the optical image onto an image array 44. The image array 44 produces an electronic signal representative of the image. The electronic signal is provided to an image input 50 of an image processor 52. A tilt sensor 46 is also included in the camera system to provide indication of the angle at which the camera is held and provides a signal indicative of the rotation of the camera to an angle input 48 of the image processor 52. The image processor 52 is arranged to generate one or more crop boundaries according to the above described method of the present invention to correct the tilt of the original image. The corrected output may either be stored on an image recording means 54, such as a hard disk, ram card or other storage means, or may alternatively or additionally be displayed on a display means 56. The display means 56 may for example be the view finder of the camera system or alternatively may be a display screen of an image viewing system.

[0049] The image processor may be allowed to freely identify the areas of interest within the image. However, in an alternative processing mode it may be responsive to user intervention. Thus , the user may use cursor keys or some other pointing device to identify an object that is to be included in the image. The image processor may then analyse the image to identify the boundaries and/or spatial extent of the object. As a further alternative an assumption can be made that the user probably framed the image such that an object that is to be included is in the vicinity of the centre of the image. The image processor may then weight objects near the centre of the image such that they are deemed to be of increased significance. Thus, in effect, a camera can be used as a pointer.

[0050] As a further option, the image processor may be preferentially responsive to tags or markers placed on subjects to be included in the final cropped image. Such tags or markers may be invisible to the human eye, but may reflect in the infra-red or UV wavelengths such that they can be identified by a suitably enabled camera.

[0051] It will be appreciated that the tilt sensor may be dispensed with and the “vertical” or “horizontal” directions may be determined from image analysis or by user input. The system need not be restricted to cameras, but may also apply to image scanners and other devices which are used to capture electronic images.

[0052]FIG. 9 schematically illustrates how the method of the present invention may be used to change the orientation of the crop boundary from that of the original image. The image shown in FIG. 9 is tilted away from a nominally portrait orientation. In broad terms, the image comprises an area of sky 70 and a large area of land 72. Two figures spaced closely together occur in a region 74 of the image whereas a further figure adjacent a motor vehicle occurs in the region 76 of the image. It is only the regions 74 and 76 which constitute compositionally significant areas of the image. The bulk of the regions 70 and 72 form areas of background which are identified in the saliency analysis.

[0053] The region 74 is positioned towards the centre of the image and hence it can be cropped in either a portrait format, or a landscape format, as shown and delineated by the chain line 78. However, the region 76 is positioned towards a corner of the image and it would be difficult to make a sensible cropping of this region 76 using a portrait format crop. However, a landscape format crop as delineated by chain line 80 simultaneously allows the cropped region to conform to the general shape of the area of interest therein, and also allows the crop boundary to approach the edge of the image. Thus there are advantages in allowing the cropping algorithm to switch between landscape and portrait formats, and in particular to chose a format which differs to that of the original image. As shown, areas 76 and 78 are also cropped with different aspect ratios.

[0054] It is thus possible to provide a method of and apparatus for automatic analysis of an image to define suitable crop boundaries. 

1. A method of correcting tilt of an electronic image, the method comprising: rotating an original, tilted image by a correcting angle of rotation; and automatically cropping the resulting rotated image in accordance with at least one rule selected from a predefined set of image composition rules such that the crop boundary is contained within the original image.
 2. A method of correcting tilt of an electronic image according to claim 1, wherein said image composition rules comprise: identifying one or more elements of interest within said image; selecting one or more of said identified elements to be included within the cropped image; and generating at least one crop boundary so as to include said selected elements of interest.
 3. A method as claimed in claim 1, wherein the crop boundary is rectangular and has one axis in a notionally vertical direction.
 4. A method of correcting tilt of an electronic image according to claim 1, wherein said electronic image has a predefined aspect ratio and said rotated image is cropped such that the cropped image has said predefined aspect ratio.
 5. A method of correcting tilt of an electronic image according to claim 1, wherein said crop boundary is smaller than the largest crop boundary that can be fitted within said original tilted image.
 6. A method of correcting tilt of an electronic image as claimed in claim 2, wherein the crop boundaries are calculated such that the area defined by the boundaries is determined on the basis of features in the image.
 7. A method of correcting tilt of an electronic image according to claim 1, wherein said correcting angle of rotation is determined at the time of capturing said original image.
 8. A method of correcting tilt of an electronic image according to claim 1, wherein said correcting angle of rotation is defined by a manual input.
 9. A method of correcting tilt of an electronic image according to claims 1, wherein said correcting angle of rotation is determined by analysis of said image.
 10. A method of correcting tilt of an electronic image according to claim 9, wherein said analysis comprises identifying one or more features of said original tilted image having one of a known or predicted orientation and determining the angle of rotation of said identified feature with respect to said known or predicted orientation.
 11. A method of correcting tilt, as claimed in claim 1 wherein the crop boundary can be in one of portrait and landscape format irrespective of the notional configuration of the original image.
 12. A method as claimed in claim 1, wherein the cropped image is rectangular, with an aspect ratio automatically selected by an image processor based on image content.
 13. A method of correcting tilt, wherein the method comprises: a) receiving an electronic image; b) rotating the image to correct for tilt; c) automatically analysing the image in accordance with at least one compositional rule in order to identify compositionally significant features within the image and to generate at least one crop of the image; and d) outputting the at least one cropped image; wherein the or each cropped image is not merely concentric with the original electronic image.
 14. A method as claimed in claim 13, wherein the image is analysed to identify the colours within the image and regions having a colour which occupies a relatively small portion of the image are determined to be salient.
 15. A method as claimed in claim 13, wherein one of the compositional rules includes ensuring that objects occurring in a central region of the image are included in the at least one cropped image.
 16. A method as claimed in claim 13, wherein one of the compositional rules includes performing a search for faces and including them within the crop.
 17. A method as claimed in claim 13, wherein the tilt of the image is determined by a tilt sensor at the time of image capture.
 18. A method as claimed in claim 13, wherein the tilt of the image is determined by analysis of features contained within the image.
 19. An image processing system for correcting tilt of an electronic image, comprising: an image input arranged to receive an original rotated image; an angle of rotation input arranged to receive a signal indicative of an angle of rotation associated with said original image; and an image processor connected to said image input and said angle of rotation input and arranged to rotate said original image to correct for said rotation and to crop the resulting rotated image in accordance with a predefined set of image composition rules such that the crop boundary is contained within the original image.
 20. An image processing system as claimed in claim 19, wherein the image composition rules comprise: identifying at least one region of interest within the image; selecting at least one of the identified regions to be included within the cropped image; and generating at least one crop boundary to include at least one of the identified regions.
 21. An image processing system as claimed in claim 19, wherein the at least one cropped image is not concentric with the original rotated image.
 22. An image processing system as claimed in claim 19, wherein the at least one crop boundary is smaller than the largest tilt corrected crop that can be contained within the original rotated image.
 23. An image processing system as claimed in claim 19, wherein the system includes a sensor for detecting the orientation of an image capture array.
 24. A camera including an image processing system as claimed in claim
 19. 25. An image processing system having an input for receiving an electronic representation of an image, and a data processor arranged to analyse the image to determine a rotation of the image and to identify compositionally significant features in the image, and on the basis of this analysis to present at least one cropped image by applying at least one rule of photographic composition to the compositionally significant features and also to rotate the image to correct for rotation in the electronic image.
 26. An image capture system for electronically capturing an image, comprising: optical image focussing means for optically focussing an image to be captured; an electronic image converter arranged to convert said optically focussed image into an electronic image; a sensor for determining the angle of rotation of said image capture system and generating a signal indicative of said angle of rotation; and an image processor arranged to receive the electronic image and the angle of rotation signal and to rotate the image or correct for the rotation and to crop the resulting rotated image in accordance with at least one rule selected from a predefined set of image composition rules such that the cropped image is contained within the original image.
 27. An electronic camera including a data processor responsive to a rotation sensor to provide a correction to the image captured by the camera so as to re-orientate the image and then to perform image analysis to identify salient features and to generate a crop boundary around those features in accordance with predetermined rules of image composition. 